<template>
  <div class="header-con">
    <!-- 城市定位/七日天气/登录 -->
    <div class="Calendar_left">
      <div class="Calendar_city add-position">
        <p>
          <span class="city-hidden "> {{ LocationCity }} </span>
          <span class="city-hidden-2 changecity" @click="choose">[切换]</span>
        </p>
        <div v-if="show" class="choose-area">
          <region-picker
            class="add_location"
            two-select
            :province="province"
            :city="city"
            @onchange="change"
          >
          </region-picker>
        </div>
      </div>
      <div class="Calendar_seven">
        <el-dropdown class="type-size" placement="bottom">
          <p>
            <span class="el-dropdown-link addborder">
              一周天气查看<i class="el-icon-arrow-down el-icon--right"></i
            ></span>
          </p>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item class="showweather">
              <div
                class="s-children"
                v-for="(item, index) in weatherlist"
                :key="index"
              >
                <div class="addlist">
                  <p>{{ item.date }}</p>
                </div>
                <div class="addlist">
                  <div class="icon-size-2 addstatue">
                    <img :src="item.typeicon" alt="" />
                  </div>
                </div>
                <div class="addlist">
                  <p>{{ item.highLow }}</p>
                </div>
                <div class="addlist">
                  <p>{{ item.type }}</p>
                </div>
              </div>
            </el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
      <div class="Calendar_word">
        <span>
          您好！欢迎您来到三一重工机械行业整合平台！
        </span>
      </div>
    </div>

    <div class="Calendar_login">
      <div class="login_img" v-show="!userlogin">
        <el-image :src="weixin_img" fit="cover"></el-image>
      </div>
      <!-- <div class="login_img" v-show="userlogin">
        <el-image :src="imgurl + headerimg" fit="cover"></el-image>
      </div> -->
      <div class="login_img" v-show="userlogin">
        <el-image :src="userceneter" fit="cover"></el-image>
      </div>
      <p class="addmouse" v-show="!userlogin" @click="Tologin()">
        <span>微信登录</span>
      </p>

      <el-dropdown
        v-show="userlogin"
        class="type-size"
        placement="bottom"
        @command="Topublic"
      >
        <el-button v-show="userlogin" type="success"
          >{{ nick_name }}<i class="el-icon-caret-bottom el-icon--right"></i
        ></el-button>

        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item
            class="addstuats"
            v-for="(item, index) in userlist"
            :key="index"
            :command="item.link"
            >{{ item.name }}</el-dropdown-item
          >
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>
<script>
//import "../../ElementUI/tqw_widget_float.js";
//import BMap from "BMap"; //引入百度地图定位
import loadBMap from "@common/loadBMap.js";
export default {
  data() {
    return {
      imgurl: this.$urls,
      userceneter: require("../../assets/images/userceneter.png"),
      //天气部分
      weatherlist: [], //七日天气列表
      weathericontoday: "http://open.itboy.net/images/tianqi/unknown.png", //默认天气图标
      weathericon: "http://open.itboy.net/images/tianqi/unknown.png", //未知天气类型
      typeicon: [
        {
          id: 0,
          name: "晴",
          icon: "http://open.itboy.net/images/tianqi/fine.png"
        },
        {
          id: 1,
          name: "多云",
          icon: "http://open.itboy.net/images/tianqi/cloud.png"
        },

        {
          id: 2,
          name: "阴",
          icon: "http://open.itboy.net/images/tianqi/overcast.png"
        },
        {
          id: 3,
          name: "小雨",
          icon: "http://open.itboy.net/images/tianqi/small_rain.png"
        },
        {
          id: 4,
          name: "小到中雨",
          icon: "http://open.itboy.net/images/tianqi/stom_rain.png"
        },
        {
          id: 5,
          name: "阵雨",
          icon: "http://open.itboy.net/images/tianqi/quick_rain.png"
        },
        {
          id: 6,
          name: "雷阵雨",
          icon: "http://open.itboy.net/images/tianqi/lquick_rain.png"
        },
        {
          id: 7,
          name: "中雨",
          icon: "http://open.itboy.net/images/tianqi/mid_rain.png"
        },
        {
          id: 8,
          name: "中到大雨",
          icon: "http://open.itboy.net/images/tianqi/big_rain.png"
        },
        {
          id: 9,
          name: "大雨",
          icon: "http://open.itboy.net/images/tianqi/big_rain.png"
        },
        {
          id: 10,
          name: "大到暴雨",
          icon: "http://open.itboy.net/images/tianqi/mbig_rain.png"
        },
        {
          id: 11,
          name: "暴雨",
          icon: "http://open.itboy.net/images/tianqi/mbig_rain.png"
        },
        {
          id: 12,
          name: "暴雨到大暴雨",
          icon: "http://open.itboy.net/images/tianqi/mbig_rain.png"
        },
        {
          id: 13,
          name: "大暴雨",
          icon: "http://open.itboy.net/images/tianqi/mbig_rain.png"
        },
        {
          id: 14,
          name: "大暴雨到特大暴雨",
          icon: "http://open.itboy.net/images/tianqi/mbig_rain.png"
        },
        {
          id: 15,
          name: "特大暴雨",
          icon: "http://open.itboy.net/images/tianqi/mbig_rain.png"
        },
        {
          id: 16,
          name: "雨夹雪",
          icon: "http://open.itboy.net/images/tianqi/rain_snow.png"
        },
        {
          id: 17,
          name: "阵雪",
          icon: "http://open.itboy.net/images/tianqi/quick_snow.png"
        },
        {
          id: 18,
          name: "冻雨",
          icon: "http://open.itboy.net/images/tianqi/ice_rain.png"
        },
        {
          id: 19,
          name: "雷阵雨伴有冰雹",
          icon: "http://open.itboy.net/images/tianqi/quick_rain_ice.png"
        },
        {
          id: 20,
          name: "雾",
          icon: "http://open.itboy.net/images/tianqi/fog.png"
        },
        {
          id: 21,
          name: "雾霾",
          icon: "http://open.itboy.net/images/tianqi/sand.png"
        },
        {
          id: 22,
          name: "浮尘",
          icon: "http://open.itboy.net/images/tianqi/sand.png"
        },
        {
          id: 23,
          name: "扬沙",
          icon: "http://open.itboy.net/images/tianqi/sand.png"
        },
        {
          id: 24,
          name: "沙尘暴",
          icon: "http://open.itboy.net/images/tianqi/sand.png"
        },
        {
          id: 25,
          name: "强沙尘暴",
          icon: "http://open.itboy.net/images/tianqi/sand.png"
        },
        {
          id: 26,
          name: "未知天气类型",
          icon: "http://open.itboy.net/images/tianqi/unknown.png"
        }
      ],
      //切换城市
      province: "云南", // you can set initial value or not.
      city: 440100, // by code or name.
      district: "",
      LocationCity: "正在定位",
      show: false, //给渲染层定义一个初始值

      weixin_img: require("../../assets/images/icon_weixin.png"),
      userlogin: true, //用户登录状态
      loginId: "",
      userlist: [
        {
          id: 0,
          name: "我的发布",
          link: "/Usercenter"
        },
        {
          id: 1,
          name: "我的关注",
          link: "/Usercenter"
        },
        {
          id: 2,
          name: "我要发布",
          link: "/Usercenter"
        },
        {
          id: 3,
          name: "投放广告",
          link: "/Usercenter"
        },
        {
          id: 4,
          name: "退出登录",
          link: "/"
        }
      ],
      userId: "",
      nick_name: "测试",
      phone: "",
      headerimg: "",
      idenName: "",
      adcode: 0, //城市编码（高德）
      //天气api 城市对照json
      CityApijson: [
        {
          city_code: "101010100",
          name: "北京",
          province_name: "北京",
          parent_name: "中国",
          lng: "39.904989",
          lat: "116.405285"
        },
        {
          city_code: "101020100",
          name: "上海",
          province_name: "上海",
          parent_name: "中国",
          lng: "31.231706",
          lat: "121.472644"
        },
        {
          city_code: "101030100",
          name: "天津",
          province_name: "天津",
          parent_name: "中国",
          lng: "39.125596",
          lat: "117.190182"
        },
        {
          city_code: "101040100",
          name: "重庆",
          province_name: "重庆",
          parent_name: "中国",
          lng: "29.291965",
          lat: "108.170255"
        },
        {
          city_code: "101050101",
          name: "哈尔滨",
          province_name: "黑龙江",
          parent_name: "哈尔滨",
          lng: "45.756967",
          lat: "126.642464"
        },
        {
          city_code: "101050201",
          name: "齐齐哈尔",
          province_name: "黑龙江",
          parent_name: "齐齐哈尔",
          lng: "47.342081",
          lat: "123.95792"
        },
        {
          city_code: "101050301",
          name: "牡丹江",
          province_name: "黑龙江",
          parent_name: "牡丹江",
          lng: "44.582962",
          lat: "129.618602"
        },
        {
          city_code: "101050401",
          name: "佳木斯",
          province_name: "黑龙江",
          parent_name: "佳木斯",
          lng: "46.809606",
          lat: "130.361634"
        },
        {
          city_code: "101050501",
          name: "绥化",
          province_name: "黑龙江",
          parent_name: "绥化",
          lng: "46.637393",
          lat: "126.99293"
        },
        {
          city_code: "101050601",
          name: "黑河",
          province_name: "黑龙江",
          parent_name: "黑河",
          lng: "50.249585",
          lat: "127.499023"
        },
        {
          city_code: "101050701",
          name: "大兴安岭",
          province_name: "黑龙江",
          parent_name: "大兴安岭",
          lng: "52.335262",
          lat: "124.711526"
        },
        {
          city_code: "101050801",
          name: "伊春",
          province_name: "黑龙江",
          parent_name: "伊春",
          lng: "47.726851",
          lat: "128.899284"
        },
        {
          city_code: "101050901",
          name: "大庆",
          province_name: "黑龙江",
          parent_name: "大庆",
          lng: "46.590734",
          lat: "125.11272"
        },
        {
          city_code: "101051002",
          name: "七台河",
          province_name: "黑龙江",
          parent_name: "七台河",
          lng: "45.771266",
          lat: "131.015584"
        },
        {
          city_code: "101051101",
          name: "鸡西",
          province_name: "黑龙江",
          parent_name: "鸡西",
          lng: "45.300046",
          lat: "130.975966"
        },
        {
          city_code: "101051201",
          name: "鹤岗",
          province_name: "黑龙江",
          parent_name: "鹤岗",
          lng: "47.332085",
          lat: "130.277487"
        },
        {
          city_code: "101051301",
          name: "双鸭山",
          province_name: "黑龙江",
          parent_name: "双鸭山",
          lng: "46.643442",
          lat: "131.157304"
        },
        {
          city_code: "101060101",
          name: "长春",
          province_name: "吉林",
          parent_name: "长春",
          lng: "43.886841",
          lat: "125.3245"
        },
        {
          city_code: "101060201",
          name: "吉林",
          province_name: "吉林",
          parent_name: "中国",
          lng: "43.843577",
          lat: "126.55302"
        },
        {
          city_code: "101060301",
          name: "延吉",
          province_name: "吉林",
          parent_name: "延边",
          lng: "42.906964",
          lat: "129.51579"
        },
        {
          city_code: "101060401",
          name: "四平",
          province_name: "吉林",
          parent_name: "四平",
          lng: "43.170344",
          lat: "124.370785"
        },
        {
          city_code: "101060501",
          name: "通化",
          province_name: "吉林",
          parent_name: "通化",
          lng: "41.721177",
          lat: "125.936501"
        },
        {
          city_code: "101060601",
          name: "白城",
          province_name: "吉林",
          parent_name: "白城",
          lng: "45.619026",
          lat: "122.841114"
        },
        {
          city_code: "101060701",
          name: "辽源",
          province_name: "吉林",
          parent_name: "辽源",
          lng: "42.902692",
          lat: "125.145349"
        },
        {
          city_code: "101060801",
          name: "松原",
          province_name: "吉林",
          parent_name: "松原",
          lng: "45.118243",
          lat: "124.823608"
        },
        {
          city_code: "101060901",
          name: "白山",
          province_name: "吉林",
          parent_name: "白山",
          lng: "41.942505",
          lat: "126.427839"
        },
        {
          city_code: "101070101",
          name: "沈阳",
          province_name: "辽宁",
          parent_name: "沈阳",
          lng: "41.796767",
          lat: "123.429096"
        },
        {
          city_code: "101070201",
          name: "大连",
          province_name: "辽宁",
          parent_name: "大连",
          lng: "38.91459",
          lat: "121.618622"
        },
        {
          city_code: "101070301",
          name: "鞍山",
          province_name: "辽宁",
          parent_name: "鞍山",
          lng: "41.110626",
          lat: "122.995632"
        },
        {
          city_code: "101070401",
          name: "抚顺",
          province_name: "辽宁",
          parent_name: "抚顺",
          lng: "41.922644",
          lat: "124.097979"
        },
        {
          city_code: "101070501",
          name: "本溪",
          province_name: "辽宁",
          parent_name: "本溪",
          lng: "41.297909",
          lat: "123.770519"
        },
        {
          city_code: "101070601",
          name: "丹东",
          province_name: "辽宁",
          parent_name: "丹东",
          lng: "40.124296",
          lat: "124.383044"
        },
        {
          city_code: "101070701",
          name: "锦州",
          province_name: "辽宁",
          parent_name: "锦州",
          lng: "41.119269",
          lat: "121.135742"
        },
        {
          city_code: "101070801",
          name: "营口",
          province_name: "辽宁",
          parent_name: "营口",
          lng: "40.667432",
          lat: "122.235151"
        },
        {
          city_code: "101070901",
          name: "阜新",
          province_name: "辽宁",
          parent_name: "阜新",
          lng: "42.058607",
          lat: "121.743125"
        },
        {
          city_code: "101071001",
          name: "辽阳",
          province_name: "辽宁",
          parent_name: "辽阳",
          lng: "41.269402",
          lat: "123.18152"
        },
        {
          city_code: "101071101",
          name: "铁岭",
          province_name: "辽宁",
          parent_name: "铁岭",
          lng: "42.223316",
          lat: "123.725669"
        },
        {
          city_code: "101071201",
          name: "朝阳",
          province_name: "辽宁",
          parent_name: "朝阳",
          lng: "41.576758",
          lat: "120.451176"
        },
        {
          city_code: "101071301",
          name: "盘锦",
          province_name: "辽宁",
          parent_name: "盘锦",
          lng: "41.124484",
          lat: "122.06957"
        },
        {
          city_code: "101071401",
          name: "葫芦岛",
          province_name: "辽宁",
          parent_name: "葫芦岛",
          lng: "40.755572",
          lat: "120.856394"
        },
        {
          city_code: "101080101",
          name: "呼和浩特",
          province_name: "内蒙古",
          parent_name: "呼和浩特",
          lng: "40.818311",
          lat: "111.670801"
        },
        {
          city_code: "101080201",
          name: "包头",
          province_name: "内蒙古",
          parent_name: "包头",
          lng: "40.658168",
          lat: "109.840405"
        },
        {
          city_code: "101080301",
          name: "乌海",
          province_name: "内蒙古",
          parent_name: "乌海",
          lng: "39.673734",
          lat: "106.825563"
        },
        {
          city_code: "101080405",
          name: "乌兰察布",
          province_name: "内蒙古",
          parent_name: "乌兰察布",
          lng: "41.034126",
          lat: "113.114543"
        },
        {
          city_code: "101080501",
          name: "通辽",
          province_name: "内蒙古",
          parent_name: "通辽",
          lng: "43.617429",
          lat: "122.263119"
        },
        {
          city_code: "101080601",
          name: "赤峰",
          province_name: "内蒙古",
          parent_name: "赤峰",
          lng: "42.275317",
          lat: "118.956806"
        },
        {
          city_code: "101080701",
          name: "鄂尔多斯",
          province_name: "内蒙古",
          parent_name: "鄂尔多斯",
          lng: "39.817179",
          lat: "109.99029"
        },
        {
          city_code: "101080811",
          name: "巴彦淖尔",
          province_name: "内蒙古",
          parent_name: "巴彦淖尔",
          lng: "40.757402",
          lat: "107.416959"
        },
        {
          city_code: "101080902",
          name: "锡林郭勒",
          province_name: "内蒙古",
          parent_name: "锡林郭勒",
          lng: "43.944018",
          lat: "116.090996"
        },
        {
          city_code: "101081013",
          name: "呼伦贝尔",
          province_name: "内蒙古",
          parent_name: "呼伦贝尔",
          lng: "49.215333",
          lat: "119.758168"
        },
        {
          city_code: "101081108",
          name: "兴安盟",
          province_name: "内蒙古",
          parent_name: "兴安盟",
          lng: "46.076268",
          lat: "122.070317"
        },
        {
          city_code: "101081213",
          name: "阿拉善盟",
          province_name: "内蒙古",
          parent_name: "阿拉善盟",
          lng: "38.844814",
          lat: "105.706422"
        },
        {
          city_code: "101090101",
          name: "石家庄",
          province_name: "河北",
          parent_name: "石家庄",
          lng: "38.045474",
          lat: "114.502461"
        },
        {
          city_code: "101090201",
          name: "保定",
          province_name: "河北",
          parent_name: "保定",
          lng: "38.867657",
          lat: "115.482331"
        },
        {
          city_code: "101090301",
          name: "张家口",
          province_name: "河北",
          parent_name: "张家口",
          lng: "40.811901",
          lat: "114.884091"
        },
        {
          city_code: "101090402",
          name: "承德",
          province_name: "河北",
          parent_name: "承德",
          lng: "40.976204",
          lat: "117.939152"
        },
        {
          city_code: "101090501",
          name: "唐山",
          province_name: "河北",
          parent_name: "唐山",
          lng: "39.635113",
          lat: "118.175393"
        },
        {
          city_code: "101090601",
          name: "廊坊",
          province_name: "河北",
          parent_name: "廊坊",
          lng: "39.523927",
          lat: "116.704441"
        },
        {
          city_code: "101090701",
          name: "沧州",
          province_name: "河北",
          parent_name: "沧州",
          lng: "38.310582",
          lat: "116.857461"
        },
        {
          city_code: "101090801",
          name: "衡水",
          province_name: "河北",
          parent_name: "衡水",
          lng: "37.735097",
          lat: "115.665993"
        },
        {
          city_code: "101090901",
          name: "邢台",
          province_name: "河北",
          parent_name: "邢台",
          lng: "37.05073",
          lat: "114.561132"
        },
        {
          city_code: "101091001",
          name: "邯郸",
          province_name: "河北",
          parent_name: "邯郸",
          lng: "36.612273",
          lat: "114.490686"
        },
        {
          city_code: "101091101",
          name: "秦皇岛",
          province_name: "河北",
          parent_name: "秦皇岛",
          lng: "39.942531",
          lat: "119.586579"
        },
        {
          city_code: "101100101",
          name: "太原",
          province_name: "山西",
          parent_name: "太原",
          lng: "37.857014",
          lat: "112.549248"
        },
        {
          city_code: "101100201",
          name: "大同",
          province_name: "山西",
          parent_name: "大同",
          lng: "40.090511",
          lat: "113.301438"
        },
        {
          city_code: "101100301",
          name: "阳泉",
          province_name: "山西",
          parent_name: "阳泉",
          lng: "37.861188",
          lat: "113.583285"
        },
        {
          city_code: "101100401",
          name: "晋中",
          province_name: "山西",
          parent_name: "晋中",
          lng: "37.696495",
          lat: "112.736465"
        },
        {
          city_code: "101100501",
          name: "长治",
          province_name: "山西",
          parent_name: "长治",
          lng: "36.191112",
          lat: "113.113556"
        },
        {
          city_code: "101100601",
          name: "晋城",
          province_name: "山西",
          parent_name: "晋城",
          lng: "35.497553",
          lat: "112.851274"
        },
        {
          city_code: "101100701",
          name: "临汾",
          province_name: "山西",
          parent_name: "临汾",
          lng: "36.08415",
          lat: "111.517973"
        },
        {
          city_code: "101100801",
          name: "运城",
          province_name: "山西",
          parent_name: "运城",
          lng: "35.022778",
          lat: "111.003957"
        },
        {
          city_code: "101100901",
          name: "朔州",
          province_name: "山西",
          parent_name: "朔州",
          lng: "39.331261",
          lat: "112.433387"
        },
        {
          city_code: "101101001",
          name: "忻州",
          province_name: "山西",
          parent_name: "忻州",
          lng: "38.41769",
          lat: "112.733538"
        },
        {
          city_code: "101101100",
          name: "吕梁",
          province_name: "山西",
          parent_name: "吕梁",
          lng: "37.524366",
          lat: "111.134335"
        },
        {
          city_code: "101110101",
          name: "西安",
          province_name: "陕西",
          parent_name: "西安",
          lng: "34.263161",
          lat: "108.948024"
        },
        {
          city_code: "101110200",
          name: "咸阳",
          province_name: "陕西",
          parent_name: "咸阳",
          lng: "34.333439",
          lat: "108.705117"
        },
        {
          city_code: "101110300",
          name: "延安",
          province_name: "陕西",
          parent_name: "延安",
          lng: "36.596537",
          lat: "109.49081"
        },
        {
          city_code: "101110401",
          name: "榆林",
          province_name: "陕西",
          parent_name: "榆林",
          lng: "38.290162",
          lat: "109.741193"
        },
        {
          city_code: "101110501",
          name: "渭南",
          province_name: "陕西",
          parent_name: "渭南",
          lng: "34.499381",
          lat: "109.502882"
        },
        {
          city_code: "101110601",
          name: "商洛",
          province_name: "陕西",
          parent_name: "商洛",
          lng: "33.868319",
          lat: "109.939776"
        },
        {
          city_code: "101110701",
          name: "安康",
          province_name: "陕西",
          parent_name: "安康",
          lng: "32.6903",
          lat: "109.029273"
        },
        {
          city_code: "101110801",
          name: "汉中",
          province_name: "陕西",
          parent_name: "汉中",
          lng: "33.077668",
          lat: "107.028621"
        },
        {
          city_code: "101110901",
          name: "宝鸡",
          province_name: "陕西",
          parent_name: "宝鸡",
          lng: "34.369315",
          lat: "107.14487"
        },
        {
          city_code: "101111001",
          name: "铜川",
          province_name: "陕西",
          parent_name: "铜川",
          lng: "34.916582",
          lat: "108.979608"
        },
        {
          city_code: "101111101",
          name: "杨凌",
          province_name: "陕西",
          parent_name: "杨凌",
          lng: "34.28",
          lat: "108.07"
        },
        {
          city_code: "101120101",
          name: "济南",
          province_name: "山东",
          parent_name: "济南",
          lng: "36.675807",
          lat: "117.000923"
        },
        {
          city_code: "101120201",
          name: "青岛",
          province_name: "山东",
          parent_name: "青岛",
          lng: "36.082982",
          lat: "120.355173"
        },
        {
          city_code: "101120301",
          name: "淄博",
          province_name: "山东",
          parent_name: "淄博",
          lng: "36.814939",
          lat: "118.047648"
        },
        {
          city_code: "101120401",
          name: "德州",
          province_name: "山东",
          parent_name: "德州",
          lng: "37.453968",
          lat: "116.307428"
        },
        {
          city_code: "101120501",
          name: "烟台",
          province_name: "山东",
          parent_name: "烟台",
          lng: "37.539297",
          lat: "121.391382"
        },
        {
          city_code: "101120601",
          name: "潍坊",
          province_name: "山东",
          parent_name: "潍坊",
          lng: "36.70925",
          lat: "119.107078"
        },
        {
          city_code: "101120701",
          name: "济宁",
          province_name: "山东",
          parent_name: "济宁",
          lng: "35.415393",
          lat: "116.587245"
        },
        {
          city_code: "101120801",
          name: "泰安",
          province_name: "山东",
          parent_name: "泰安",
          lng: "36.194968",
          lat: "117.129063"
        },
        {
          city_code: "101120901",
          name: "临沂",
          province_name: "山东",
          parent_name: "临沂",
          lng: "35.065282",
          lat: "118.326443"
        },
        {
          city_code: "101121001",
          name: "菏泽",
          province_name: "山东",
          parent_name: "菏泽",
          lng: "35.246531",
          lat: "115.469381"
        },
        {
          city_code: "101121101",
          name: "滨州",
          province_name: "山东",
          parent_name: "滨州",
          lng: "37.383542",
          lat: "118.016974"
        },
        {
          city_code: "101121201",
          name: "东营",
          province_name: "山东",
          parent_name: "东营",
          lng: "37.461567",
          lat: "118.507543"
        },
        {
          city_code: "101121301",
          name: "威海",
          province_name: "山东",
          parent_name: "威海",
          lng: "37.509691",
          lat: "122.116394"
        },
        {
          city_code: "101121401",
          name: "枣庄",
          province_name: "山东",
          parent_name: "枣庄",
          lng: "34.856424",
          lat: "117.557964"
        },
        {
          city_code: "101121501",
          name: "日照",
          province_name: "山东",
          parent_name: "日照",
          lng: "35.428588",
          lat: "119.461208"
        },
        {
          city_code: "101121601",
          name: "莱芜",
          province_name: "山东",
          parent_name: "莱芜",
          lng: "36.214397",
          lat: "117.677736"
        },
        {
          city_code: "101121701",
          name: "聊城",
          province_name: "山东",
          parent_name: "聊城",
          lng: "36.456013",
          lat: "115.980367"
        },
        {
          city_code: "101130101",
          name: "乌鲁木齐",
          province_name: "新疆",
          parent_name: "乌鲁木齐",
          lng: "43.792818",
          lat: "87.617733"
        },
        {
          city_code: "101130301",
          name: "石河子",
          province_name: "新疆",
          parent_name: "石河子",
          lng: "44.305886",
          lat: "86.041075"
        },
        {
          city_code: "101130401",
          name: "昌吉",
          province_name: "新疆",
          parent_name: "昌吉",
          lng: "44.014577",
          lat: "87.304012"
        },
        {
          city_code: "101130501",
          name: "吐鲁番",
          province_name: "新疆",
          parent_name: "吐鲁番",
          lng: "42.947613",
          lat: "89.184078"
        },
        {
          city_code: "101130609",
          name: "巴音郭楞",
          province_name: "新疆",
          parent_name: "巴音郭楞",
          lng: "41.768552",
          lat: "86.150969"
        },
        {
          city_code: "101130701",
          name: "阿拉尔",
          province_name: "新疆",
          parent_name: "阿拉尔",
          lng: "40.541914",
          lat: "81.285884"
        },
        {
          city_code: "101130801",
          name: "阿克苏",
          province_name: "新疆",
          parent_name: "阿克苏",
          lng: "41.170712",
          lat: "80.265068"
        },
        {
          city_code: "101130901",
          name: "喀什",
          province_name: "新疆",
          parent_name: "喀什",
          lng: "39.467664",
          lat: "75.989138"
        },
        {
          city_code: "101131012",
          name: "伊犁",
          province_name: "新疆",
          parent_name: "伊犁",
          lng: "43.92186",
          lat: "81.317946"
        },
        {
          city_code: "101131101",
          name: "塔城",
          province_name: "新疆",
          parent_name: "塔城",
          lng: "46.746281",
          lat: "82.983988"
        },
        {
          city_code: "101131201",
          name: "哈密",
          province_name: "新疆",
          parent_name: "哈密",
          lng: "42.833248",
          lat: "93.51316"
        },
        {
          city_code: "101131301",
          name: "和田",
          province_name: "新疆",
          parent_name: "和田",
          lng: "37.108944",
          lat: "79.927542"
        },
        {
          city_code: "101131401",
          name: "阿勒泰",
          province_name: "新疆",
          parent_name: "阿勒泰",
          lng: "47.848911",
          lat: "88.138743"
        },
        {
          city_code: "101131505",
          name: "克州",
          province_name: "新疆",
          parent_name: "克州",
          lng: "39.713966",
          lat: "76.176796"
        },
        {
          city_code: "101131604",
          name: "博尔塔拉",
          province_name: "新疆",
          parent_name: "博尔塔拉",
          lng: "44.903258",
          lat: "82.074778"
        },
        {
          city_code: "101131701",
          name: "图木舒克",
          province_name: "新疆",
          parent_name: "图木舒克",
          lng: "39.867316",
          lat: "79.077978"
        },
        {
          city_code: "101131801",
          name: "五家渠",
          province_name: "新疆",
          parent_name: "五家渠",
          lng: "44.167401",
          lat: "87.526884"
        },
        {
          city_code: "101131901",
          name: "铁门关",
          province_name: "新疆",
          parent_name: "铁门关",
          lng: "41.827251",
          lat: "85.501218"
        },
        {
          city_code: "101140101",
          name: "拉萨",
          province_name: "西藏",
          parent_name: "拉萨",
          lng: "29.660361",
          lat: "91.132212"
        },
        {
          city_code: "101140201",
          name: "日喀则",
          province_name: "西藏",
          parent_name: "日喀则",
          lng: "29.267519",
          lat: "88.885148"
        },
        {
          city_code: "101140301",
          name: "山南",
          province_name: "西藏",
          parent_name: "山南",
          lng: "29.236023",
          lat: "91.766529"
        },
        {
          city_code: "101140401",
          name: "林芝",
          province_name: "西藏",
          parent_name: "林芝",
          lng: "29.654693",
          lat: "94.362348"
        },
        {
          city_code: "101140501",
          name: "昌都",
          province_name: "西藏",
          parent_name: "昌都",
          lng: "31.136875",
          lat: "97.178452"
        },
        {
          city_code: "101140601",
          name: "那曲",
          province_name: "西藏",
          parent_name: "那曲",
          lng: "31.476004",
          lat: "92.060214"
        },
        {
          city_code: "101140701",
          name: "阿里",
          province_name: "西藏",
          parent_name: "阿里",
          lng: "32.503187",
          lat: "80.105498"
        },
        {
          city_code: "101150101",
          name: "西宁",
          province_name: "青海",
          parent_name: "西宁",
          lng: "36.623178",
          lat: "101.778916"
        },
        {
          city_code: "101150207",
          name: "海东",
          province_name: "青海",
          parent_name: "海东",
          lng: "36.502916",
          lat: "102.10327"
        },
        {
          city_code: "101150402",
          name: "海南",
          province_name: "青海",
          parent_name: "海南",
          lng: "36.280353",
          lat: "100.619542"
        },
        {
          city_code: "101150507",
          name: "果洛",
          province_name: "青海",
          parent_name: "果洛",
          lng: "34.4736",
          lat: "100.242143"
        },
        {
          city_code: "101150601",
          name: "玉树",
          province_name: "青海",
          parent_name: "玉树",
          lng: "33.004049",
          lat: "97.008522"
        },
        {
          city_code: "101150702",
          name: "海西",
          province_name: "青海",
          parent_name: "海西",
          lng: "37.853631",
          lat: "95.357233"
        },
        {
          city_code: "101150804",
          name: "海北",
          province_name: "青海",
          parent_name: "海北",
          lng: "36.959435",
          lat: "100.901059"
        },
        {
          city_code: "101160101",
          name: "兰州",
          province_name: "甘肃",
          parent_name: "兰州",
          lng: "36.058039",
          lat: "103.823557"
        },
        {
          city_code: "101160201",
          name: "定西",
          province_name: "甘肃",
          parent_name: "定西",
          lng: "35.579578",
          lat: "104.626294"
        },
        {
          city_code: "101160301",
          name: "平凉",
          province_name: "甘肃",
          parent_name: "平凉",
          lng: "35.54279",
          lat: "106.684691"
        },
        {
          city_code: "101160401",
          name: "庆阳",
          province_name: "甘肃",
          parent_name: "庆阳",
          lng: "35.734218",
          lat: "107.638372"
        },
        {
          city_code: "101160501",
          name: "武威",
          province_name: "甘肃",
          parent_name: "武威",
          lng: "37.929996",
          lat: "102.634697"
        },
        {
          city_code: "101160601",
          name: "金昌",
          province_name: "甘肃",
          parent_name: "金昌",
          lng: "38.514238",
          lat: "102.187888"
        },
        {
          city_code: "101160701",
          name: "张掖",
          province_name: "甘肃",
          parent_name: "张掖",
          lng: "38.932897",
          lat: "100.455472"
        },
        {
          city_code: "101160801",
          name: "酒泉",
          province_name: "甘肃",
          parent_name: "酒泉",
          lng: "39.744023",
          lat: "98.510795"
        },
        {
          city_code: "101160901",
          name: "天水",
          province_name: "甘肃",
          parent_name: "天水",
          lng: "34.578529",
          lat: "105.724998"
        },
        {
          city_code: "101161010",
          name: "陇南",
          province_name: "甘肃",
          parent_name: "陇南",
          lng: "33.388598",
          lat: "104.929379"
        },
        {
          city_code: "101161101",
          name: "临夏",
          province_name: "甘肃",
          parent_name: "临夏",
          lng: "35.59941",
          lat: "103.211634"
        },
        {
          city_code: "101161209",
          name: "甘南",
          province_name: "甘肃",
          parent_name: "甘南",
          lng: "34.986354",
          lat: "102.911008"
        },
        {
          city_code: "101161301",
          name: "白银",
          province_name: "甘肃",
          parent_name: "白银",
          lng: "36.54568",
          lat: "104.173606"
        },
        {
          city_code: "101161401",
          name: "嘉峪关",
          province_name: "甘肃",
          parent_name: "嘉峪关",
          lng: "39.786529",
          lat: "98.277304"
        },
        {
          city_code: "101170101",
          name: "银川",
          province_name: "宁夏",
          parent_name: "银川",
          lng: "38.46637",
          lat: "106.278179"
        },
        {
          city_code: "101170201",
          name: "石嘴山",
          province_name: "宁夏",
          parent_name: "石嘴山",
          lng: "39.01333",
          lat: "106.376173"
        },
        {
          city_code: "101170301",
          name: "吴忠",
          province_name: "宁夏",
          parent_name: "吴忠",
          lng: "37.986165",
          lat: "106.199409"
        },
        {
          city_code: "101170401",
          name: "固原",
          province_name: "宁夏",
          parent_name: "固原",
          lng: "36.004561",
          lat: "106.285241"
        },
        {
          city_code: "101170501",
          name: "中卫",
          province_name: "宁夏",
          parent_name: "中卫",
          lng: "37.514951",
          lat: "105.189568"
        },
        {
          city_code: "101180101",
          name: "郑州",
          province_name: "河南",
          parent_name: "郑州",
          lng: "34.757975",
          lat: "113.665412"
        },
        {
          city_code: "101180201",
          name: "安阳",
          province_name: "河南",
          parent_name: "安阳",
          lng: "36.103442",
          lat: "114.352482"
        },
        {
          city_code: "101180301",
          name: "新乡",
          province_name: "河南",
          parent_name: "新乡",
          lng: "35.190021",
          lat: "113.806186"
        },
        {
          city_code: "101180401",
          name: "许昌",
          province_name: "河南",
          parent_name: "许昌",
          lng: "34.022956",
          lat: "113.826063"
        },
        {
          city_code: "101180501",
          name: "平顶山",
          province_name: "河南",
          parent_name: "平顶山",
          lng: "33.735241",
          lat: "113.307718"
        },
        {
          city_code: "101180601",
          name: "信阳",
          province_name: "河南",
          parent_name: "信阳",
          lng: "32.123274",
          lat: "114.075031"
        },
        {
          city_code: "101180701",
          name: "南阳",
          province_name: "河南",
          parent_name: "南阳",
          lng: "32.999082",
          lat: "112.540918"
        },
        {
          city_code: "101180801",
          name: "开封",
          province_name: "河南",
          parent_name: "开封",
          lng: "34.797049",
          lat: "114.341447"
        },
        {
          city_code: "101180901",
          name: "洛阳",
          province_name: "河南",
          parent_name: "洛阳",
          lng: "34.663041",
          lat: "112.434468"
        },
        {
          city_code: "101180910",
          name: "汝阳",
          province_name: "河南",
          parent_name: "洛阳",
          lng: "34.15323",
          lat: "112.473789"
        },
        {
          city_code: "101181001",
          name: "商丘",
          province_name: "河南",
          parent_name: "商丘",
          lng: "34.437054",
          lat: "115.650497"
        },
        {
          city_code: "101181101",
          name: "焦作",
          province_name: "河南",
          parent_name: "焦作",
          lng: "35.23904",
          lat: "113.238266"
        },
        {
          city_code: "101181201",
          name: "鹤壁",
          province_name: "河南",
          parent_name: "鹤壁",
          lng: "35.748236",
          lat: "114.295444"
        },
        {
          city_code: "101181301",
          name: "濮阳",
          province_name: "河南",
          parent_name: "濮阳",
          lng: "35.768234",
          lat: "115.041299"
        },
        {
          city_code: "101181401",
          name: "周口",
          province_name: "河南",
          parent_name: "周口",
          lng: "33.620357",
          lat: "114.649653"
        },
        {
          city_code: "101181501",
          name: "漯河",
          province_name: "河南",
          parent_name: "漯河",
          lng: "33.575855",
          lat: "114.026405"
        },
        {
          city_code: "101181601",
          name: "驻马店",
          province_name: "河南",
          parent_name: "驻马店",
          lng: "32.980169",
          lat: "114.024736"
        },
        {
          city_code: "101181701",
          name: "三门峡",
          province_name: "河南",
          parent_name: "三门峡",
          lng: "34.777338",
          lat: "111.194099"
        },
        {
          city_code: "101181801",
          name: "济源",
          province_name: "河南",
          parent_name: "济源",
          lng: "35.090378",
          lat: "112.590047"
        },
        {
          city_code: "101190101",
          name: "南京",
          province_name: "江苏",
          parent_name: "南京",
          lng: "32.041544",
          lat: "118.767413"
        },
        {
          city_code: "101190201",
          name: "无锡",
          province_name: "江苏",
          parent_name: "无锡",
          lng: "31.574729",
          lat: "120.301663"
        },
        {
          city_code: "101190301",
          name: "镇江",
          province_name: "江苏",
          parent_name: "镇江",
          lng: "32.204402",
          lat: "119.452753"
        },
        {
          city_code: "101190401",
          name: "苏州",
          province_name: "江苏",
          parent_name: "苏州",
          lng: "31.299379",
          lat: "120.619585"
        },
        {
          city_code: "101190501",
          name: "南通",
          province_name: "江苏",
          parent_name: "南通",
          lng: "32.016212",
          lat: "120.864608"
        },
        {
          city_code: "101190601",
          name: "扬州",
          province_name: "江苏",
          parent_name: "扬州",
          lng: "32.393159",
          lat: "119.421003"
        },
        {
          city_code: "101190701",
          name: "盐城",
          province_name: "江苏",
          parent_name: "盐城",
          lng: "33.377631",
          lat: "120.139998"
        },
        {
          city_code: "101190801",
          name: "徐州",
          province_name: "江苏",
          parent_name: "徐州",
          lng: "34.261792",
          lat: "117.184811"
        },
        {
          city_code: "101190901",
          name: "淮安",
          province_name: "江苏",
          parent_name: "淮安",
          lng: "33.597506",
          lat: "119.021265"
        },
        {
          city_code: "101191001",
          name: "连云港",
          province_name: "江苏",
          parent_name: "连云港",
          lng: "34.600018",
          lat: "119.178821"
        },
        {
          city_code: "101191101",
          name: "常州",
          province_name: "江苏",
          parent_name: "常州",
          lng: "31.772752",
          lat: "119.946973"
        },
        {
          city_code: "101191201",
          name: "泰州",
          province_name: "江苏",
          parent_name: "泰州",
          lng: "32.484882",
          lat: "119.915176"
        },
        {
          city_code: "101191301",
          name: "宿迁",
          province_name: "江苏",
          parent_name: "宿迁",
          lng: "33.963008",
          lat: "118.275162"
        },
        {
          city_code: "101200101",
          name: "武汉",
          province_name: "湖北",
          parent_name: "武汉",
          lng: "30.584355",
          lat: "114.298572"
        },
        {
          city_code: "101200201",
          name: "襄阳",
          province_name: "湖北",
          parent_name: "襄阳",
          lng: "32.042426",
          lat: "112.144146"
        },
        {
          city_code: "101200301",
          name: "鄂州",
          province_name: "湖北",
          parent_name: "鄂州",
          lng: "30.396536",
          lat: "114.890593"
        },
        {
          city_code: "101200401",
          name: "孝感",
          province_name: "湖北",
          parent_name: "孝感",
          lng: "30.926423",
          lat: "113.926655"
        },
        {
          city_code: "101200501",
          name: "黄冈",
          province_name: "湖北",
          parent_name: "黄冈",
          lng: "30.447711",
          lat: "114.879365"
        },
        {
          city_code: "101200601",
          name: "黄石",
          province_name: "湖北",
          parent_name: "黄石",
          lng: "30.220074",
          lat: "115.077048"
        },
        {
          city_code: "101200701",
          name: "咸宁",
          province_name: "湖北",
          parent_name: "咸宁",
          lng: "29.832798",
          lat: "114.328963"
        },
        {
          city_code: "101200801",
          name: "荆州",
          province_name: "湖北",
          parent_name: "荆州",
          lng: "30.326857",
          lat: "112.23813"
        },
        {
          city_code: "101200901",
          name: "宜昌",
          province_name: "湖北",
          parent_name: "宜昌",
          lng: "30.702636",
          lat: "111.290843"
        },
        {
          city_code: "101201001",
          name: "恩施",
          province_name: "湖北",
          parent_name: "恩施",
          lng: "30.283114",
          lat: "109.48699"
        },
        {
          city_code: "101201101",
          name: "十堰",
          province_name: "湖北",
          parent_name: "十堰",
          lng: "32.646907",
          lat: "110.787916"
        },
        {
          city_code: "101201201",
          name: "神农架",
          province_name: "湖北",
          parent_name: "神农架",
          lng: "31.744449",
          lat: "110.671525"
        },
        {
          city_code: "101201301",
          name: "随州",
          province_name: "湖北",
          parent_name: "随州",
          lng: "31.717497",
          lat: "113.37377"
        },
        {
          city_code: "101201501",
          name: "天门",
          province_name: "湖北",
          parent_name: "天门",
          lng: "30.653061",
          lat: "113.165862"
        },
        {
          city_code: "101201601",
          name: "仙桃",
          province_name: "湖北",
          parent_name: "仙桃",
          lng: "30.364953",
          lat: "113.453974"
        },
        {
          city_code: "101201701",
          name: "潜江",
          province_name: "湖北",
          parent_name: "潜江",
          lng: "30.421215",
          lat: "112.896866"
        },
        {
          city_code: "101210101",
          name: "杭州",
          province_name: "浙江",
          parent_name: "杭州",
          lng: "30.287459",
          lat: "120.153576"
        },
        {
          city_code: "101210201",
          name: "湖州",
          province_name: "浙江",
          parent_name: "湖州",
          lng: "30.867198",
          lat: "120.102398"
        },
        {
          city_code: "101210301",
          name: "嘉兴",
          province_name: "浙江",
          parent_name: "嘉兴",
          lng: "30.762653",
          lat: "120.750865"
        },
        {
          city_code: "101210401",
          name: "宁波",
          province_name: "浙江",
          parent_name: "宁波",
          lng: "29.868388",
          lat: "121.549792"
        },
        {
          city_code: "101210507",
          name: "绍兴",
          province_name: "浙江",
          parent_name: "绍兴",
          lng: "29.997117",
          lat: "120.582112"
        },
        {
          city_code: "101210601",
          name: "台州",
          province_name: "浙江",
          parent_name: "台州",
          lng: "28.661378",
          lat: "121.428599"
        },
        {
          city_code: "101210701",
          name: "温州",
          province_name: "浙江",
          parent_name: "温州",
          lng: "28.000575",
          lat: "120.672111"
        },
        {
          city_code: "101210801",
          name: "丽水",
          province_name: "浙江",
          parent_name: "丽水",
          lng: "28.451993",
          lat: "119.921786"
        },
        {
          city_code: "101210901",
          name: "金华",
          province_name: "浙江",
          parent_name: "金华",
          lng: "29.089524",
          lat: "119.649506"
        },
        {
          city_code: "101211001",
          name: "衢州",
          province_name: "浙江",
          parent_name: "衢州",
          lng: "28.941708",
          lat: "118.87263"
        },
        {
          city_code: "101211101",
          name: "舟山",
          province_name: "浙江",
          parent_name: "舟山",
          lng: "30.016028",
          lat: "122.106863"
        },
        {
          city_code: "101220101",
          name: "合肥",
          province_name: "安徽",
          parent_name: "合肥",
          lng: "31.86119",
          lat: "117.283042"
        },
        {
          city_code: "101220201",
          name: "蚌埠",
          province_name: "安徽",
          parent_name: "蚌埠",
          lng: "32.939667",
          lat: "117.363228"
        },
        {
          city_code: "101220301",
          name: "芜湖",
          province_name: "安徽",
          parent_name: "芜湖",
          lng: "31.326319",
          lat: "118.376451"
        },
        {
          city_code: "101220401",
          name: "淮南",
          province_name: "安徽",
          parent_name: "淮南",
          lng: "32.647574",
          lat: "117.018329"
        },
        {
          city_code: "101220501",
          name: "马鞍山",
          province_name: "安徽",
          parent_name: "马鞍山",
          lng: "31.689362",
          lat: "118.507906"
        },
        {
          city_code: "101220601",
          name: "安庆",
          province_name: "安徽",
          parent_name: "安庆",
          lng: "30.50883",
          lat: "117.043551"
        },
        {
          city_code: "101220701",
          name: "宿州",
          province_name: "安徽",
          parent_name: "宿州",
          lng: "33.633891",
          lat: "116.984084"
        },
        {
          city_code: "101220801",
          name: "阜阳",
          province_name: "安徽",
          parent_name: "阜阳",
          lng: "32.896969",
          lat: "115.819729"
        },
        {
          city_code: "101220901",
          name: "亳州",
          province_name: "安徽",
          parent_name: "亳州",
          lng: "33.869338",
          lat: "115.782939"
        },
        {
          city_code: "101221001",
          name: "黄山",
          province_name: "安徽",
          parent_name: "黄山",
          lng: "29.709239",
          lat: "118.317325"
        },
        {
          city_code: "101221101",
          name: "滁州",
          province_name: "安徽",
          parent_name: "滁州",
          lng: "32.303627",
          lat: "118.316264"
        },
        {
          city_code: "101221201",
          name: "淮北",
          province_name: "安徽",
          parent_name: "淮北",
          lng: "33.971707",
          lat: "116.794664"
        },
        {
          city_code: "101221301",
          name: "铜陵",
          province_name: "安徽",
          parent_name: "铜陵",
          lng: "30.929935",
          lat: "117.816576"
        },
        {
          city_code: "101221401",
          name: "宣城",
          province_name: "安徽",
          parent_name: "宣城",
          lng: "30.945667",
          lat: "118.757995"
        },
        {
          city_code: "101221501",
          name: "六安",
          province_name: "安徽",
          parent_name: "六安",
          lng: "31.752889",
          lat: "116.507676"
        },
        {
          city_code: "101221701",
          name: "池州",
          province_name: "安徽",
          parent_name: "池州",
          lng: "30.656037",
          lat: "117.489157"
        },
        {
          city_code: "101230101",
          name: "福州",
          province_name: "福建",
          parent_name: "福州",
          lng: "26.075302",
          lat: "119.306239"
        },
        {
          city_code: "101230201",
          name: "厦门",
          province_name: "福建",
          parent_name: "厦门",
          lng: "24.490474",
          lat: "118.11022"
        },
        {
          city_code: "101230301",
          name: "宁德",
          province_name: "福建",
          parent_name: "宁德",
          lng: "26.65924",
          lat: "119.527082"
        },
        {
          city_code: "101230401",
          name: "莆田",
          province_name: "福建",
          parent_name: "莆田",
          lng: "25.431011",
          lat: "119.007558"
        },
        {
          city_code: "101230501",
          name: "泉州",
          province_name: "福建",
          parent_name: "泉州",
          lng: "24.908853",
          lat: "118.589421"
        },
        {
          city_code: "101230601",
          name: "漳州",
          province_name: "福建",
          parent_name: "漳州",
          lng: "24.510897",
          lat: "117.661801"
        },
        {
          city_code: "101230701",
          name: "龙岩",
          province_name: "福建",
          parent_name: "龙岩",
          lng: "25.091603",
          lat: "117.02978"
        },
        {
          city_code: "101230801",
          name: "三明",
          province_name: "福建",
          parent_name: "三明",
          lng: "26.265444",
          lat: "117.635001"
        },
        {
          city_code: "101230901",
          name: "南平",
          province_name: "福建",
          parent_name: "南平",
          lng: "26.635627",
          lat: "118.178459"
        },
        {
          city_code: "101231001",
          name: "钓鱼岛",
          province_name: "福建",
          parent_name: "钓鱼岛",
          lng: "25.73",
          lat: "123.46"
        },
        {
          city_code: "101240101",
          name: "南昌",
          province_name: "江西",
          parent_name: "南昌",
          lng: "28.676493",
          lat: "115.892151"
        },
        {
          city_code: "101240201",
          name: "九江",
          province_name: "江西",
          parent_name: "九江",
          lng: "29.712034",
          lat: "115.992811"
        },
        {
          city_code: "101240301",
          name: "上饶",
          province_name: "江西",
          parent_name: "上饶",
          lng: "28.44442",
          lat: "117.971185"
        },
        {
          city_code: "101240401",
          name: "抚州",
          province_name: "江西",
          parent_name: "抚州",
          lng: "27.98385",
          lat: "116.358351"
        },
        {
          city_code: "101240501",
          name: "宜春",
          province_name: "江西",
          parent_name: "宜春",
          lng: "27.8043",
          lat: "114.391136"
        },
        {
          city_code: "101240601",
          name: "吉安",
          province_name: "江西",
          parent_name: "吉安",
          lng: "27.111699",
          lat: "114.986373"
        },
        {
          city_code: "101240701",
          name: "赣州",
          province_name: "江西",
          parent_name: "赣州",
          lng: "25.85097",
          lat: "114.940278"
        },
        {
          city_code: "101240801",
          name: "景德镇",
          province_name: "江西",
          parent_name: "景德镇",
          lng: "29.29256",
          lat: "117.214664"
        },
        {
          city_code: "101240901",
          name: "萍乡",
          province_name: "江西",
          parent_name: "萍乡",
          lng: "27.622946",
          lat: "113.852186"
        },
        {
          city_code: "101241001",
          name: "新余",
          province_name: "江西",
          parent_name: "新余",
          lng: "27.810834",
          lat: "114.930835"
        },
        {
          city_code: "101250101",
          name: "长沙",
          province_name: "湖南",
          parent_name: "长沙",
          lng: "28.19409",
          lat: "112.982279"
        },
        {
          city_code: "101250201",
          name: "湘潭",
          province_name: "湖南",
          parent_name: "湘潭",
          lng: "27.82973",
          lat: "112.944052"
        },
        {
          city_code: "101250301",
          name: "株洲",
          province_name: "湖南",
          parent_name: "株洲",
          lng: "27.835806",
          lat: "113.151737"
        },
        {
          city_code: "101250401",
          name: "衡阳",
          province_name: "湖南",
          parent_name: "衡阳",
          lng: "26.900358",
          lat: "112.607693"
        },
        {
          city_code: "101250501",
          name: "郴州",
          province_name: "湖南",
          parent_name: "郴州",
          lng: "25.793589",
          lat: "113.032067"
        },
        {
          city_code: "101250601",
          name: "常德",
          province_name: "湖南",
          parent_name: "常德",
          lng: "29.040225",
          lat: "111.691347"
        },
        {
          city_code: "101250700",
          name: "益阳",
          province_name: "湖南",
          parent_name: "益阳",
          lng: "28.570066",
          lat: "112.355042"
        },
        {
          city_code: "101250801",
          name: "娄底",
          province_name: "湖南",
          parent_name: "娄底",
          lng: "27.728136",
          lat: "112.008497"
        },
        {
          city_code: "101250901",
          name: "邵阳",
          province_name: "湖南",
          parent_name: "邵阳",
          lng: "27.237842",
          lat: "111.46923"
        },
        {
          city_code: "101251001",
          name: "岳阳",
          province_name: "湖南",
          parent_name: "岳阳",
          lng: "29.37029",
          lat: "113.132855"
        },
        {
          city_code: "101251101",
          name: "张家界",
          province_name: "湖南",
          parent_name: "张家界",
          lng: "29.127401",
          lat: "110.479921"
        },
        {
          city_code: "101251201",
          name: "怀化",
          province_name: "湖南",
          parent_name: "怀化",
          lng: "27.550082",
          lat: "109.97824"
        },
        {
          city_code: "101251401",
          name: "永州",
          province_name: "湖南",
          parent_name: "永州",
          lng: "26.434516",
          lat: "111.608019"
        },
        {
          city_code: "101251509",
          name: "湘西",
          province_name: "湖南",
          parent_name: "湘西",
          lng: "28.314296",
          lat: "109.739735"
        },
        {
          city_code: "101260101",
          name: "贵阳",
          province_name: "贵州",
          parent_name: "贵阳",
          lng: "26.578343",
          lat: "106.713478"
        },
        {
          city_code: "101260201",
          name: "遵义",
          province_name: "贵州",
          parent_name: "遵义",
          lng: "27.706626",
          lat: "106.937265"
        },
        {
          city_code: "101260301",
          name: "安顺",
          province_name: "贵州",
          parent_name: "安顺",
          lng: "26.245544",
          lat: "105.932188"
        },
        {
          city_code: "101260413",
          name: "黔南",
          province_name: "贵州",
          parent_name: "黔南",
          lng: "26.258219",
          lat: "107.517156"
        },
        {
          city_code: "101260506",
          name: "黔东南",
          province_name: "贵州",
          parent_name: "黔东南",
          lng: "26.583352",
          lat: "107.977488"
        },
        {
          city_code: "101260601",
          name: "铜仁",
          province_name: "贵州",
          parent_name: "铜仁",
          lng: "27.718346",
          lat: "109.191555"
        },
        {
          city_code: "101260701",
          name: "毕节",
          province_name: "贵州",
          parent_name: "毕节",
          lng: "27.301693",
          lat: "105.28501"
        },
        {
          city_code: "101260803",
          name: "六盘水",
          province_name: "贵州",
          parent_name: "六盘水",
          lng: "26.584643",
          lat: "104.846743"
        },
        {
          city_code: "101260906",
          name: "黔西南",
          province_name: "贵州",
          parent_name: "黔西南",
          lng: "25.08812",
          lat: "104.897971"
        },
        {
          city_code: "101270101",
          name: "成都",
          province_name: "四川",
          parent_name: "成都",
          lng: "30.659462",
          lat: "104.065735"
        },
        {
          city_code: "101270201",
          name: "攀枝花",
          province_name: "四川",
          parent_name: "攀枝花",
          lng: "26.580446",
          lat: "101.716007"
        },
        {
          city_code: "101270301",
          name: "自贡",
          province_name: "四川",
          parent_name: "自贡",
          lng: "29.352765",
          lat: "104.773447"
        },
        {
          city_code: "101270401",
          name: "绵阳",
          province_name: "四川",
          parent_name: "绵阳",
          lng: "31.46402",
          lat: "104.741722"
        },
        {
          city_code: "101270501",
          name: "南充",
          province_name: "四川",
          parent_name: "南充",
          lng: "30.795281",
          lat: "106.082974"
        },
        {
          city_code: "101270601",
          name: "达州",
          province_name: "四川",
          parent_name: "达州",
          lng: "31.209484",
          lat: "107.502262"
        },
        {
          city_code: "101270701",
          name: "遂宁",
          province_name: "四川",
          parent_name: "遂宁",
          lng: "30.513311",
          lat: "105.571331"
        },
        {
          city_code: "101270801",
          name: "广安",
          province_name: "四川",
          parent_name: "广安",
          lng: "30.456398",
          lat: "106.633369"
        },
        {
          city_code: "101270901",
          name: "巴中",
          province_name: "四川",
          parent_name: "巴中",
          lng: "31.858809",
          lat: "106.753669"
        },
        {
          city_code: "101271001",
          name: "泸州",
          province_name: "四川",
          parent_name: "泸州",
          lng: "28.889138",
          lat: "105.443348"
        },
        {
          city_code: "101271101",
          name: "宜宾",
          province_name: "四川",
          parent_name: "宜宾",
          lng: "28.760189",
          lat: "104.630825"
        },
        {
          city_code: "101271201",
          name: "内江",
          province_name: "四川",
          parent_name: "内江",
          lng: "29.58708",
          lat: "105.066138"
        },
        {
          city_code: "101271301",
          name: "资阳",
          province_name: "四川",
          parent_name: "资阳",
          lng: "30.122211",
          lat: "104.641917"
        },
        {
          city_code: "101271401",
          name: "乐山",
          province_name: "四川",
          parent_name: "乐山",
          lng: "29.582024",
          lat: "103.761263"
        },
        {
          city_code: "101271501",
          name: "眉山",
          province_name: "四川",
          parent_name: "眉山",
          lng: "30.048318",
          lat: "103.831788"
        },
        {
          city_code: "101271601",
          name: "凉山",
          province_name: "四川",
          parent_name: "凉山",
          lng: "27.886762",
          lat: "102.258746"
        },
        {
          city_code: "101271701",
          name: "雅安",
          province_name: "四川",
          parent_name: "雅安",
          lng: "29.987722",
          lat: "103.001033"
        },
        {
          city_code: "101271801",
          name: "甘孜",
          province_name: "四川",
          parent_name: "甘孜",
          lng: "30.050663",
          lat: "101.963815"
        },
        {
          city_code: "101271901",
          name: "阿坝",
          province_name: "四川",
          parent_name: "阿坝",
          lng: "31.899792",
          lat: "102.221374"
        },
        {
          city_code: "101272001",
          name: "德阳",
          province_name: "四川",
          parent_name: "德阳",
          lng: "31.127991",
          lat: "104.398651"
        },
        {
          city_code: "101272101",
          name: "广元",
          province_name: "四川",
          parent_name: "广元",
          lng: "32.433668",
          lat: "105.829757"
        },
        {
          city_code: "101280101",
          name: "广州",
          province_name: "广东",
          parent_name: "广州",
          lng: "23.125178",
          lat: "113.280637"
        },
        {
          city_code: "101280201",
          name: "韶关",
          province_name: "广东",
          parent_name: "韶关",
          lng: "24.801322",
          lat: "113.591544"
        },
        {
          city_code: "101280301",
          name: "惠州",
          province_name: "广东",
          parent_name: "惠州",
          lng: "23.079404",
          lat: "114.412599"
        },
        {
          city_code: "101280401",
          name: "梅州",
          province_name: "广东",
          parent_name: "梅州",
          lng: "24.299112",
          lat: "116.117582"
        },
        {
          city_code: "101280501",
          name: "汕头",
          province_name: "广东",
          parent_name: "汕头",
          lng: "23.37102",
          lat: "116.708463"
        },
        {
          city_code: "101280601",
          name: "深圳",
          province_name: "广东",
          parent_name: "深圳",
          lng: "22.547",
          lat: "114.085947"
        },
        {
          city_code: "101280701",
          name: "珠海",
          province_name: "广东",
          parent_name: "珠海",
          lng: "22.224979",
          lat: "113.553986"
        },
        {
          city_code: "101280800",
          name: "佛山",
          province_name: "广东",
          parent_name: "佛山",
          lng: "23.028762",
          lat: "113.122717"
        },
        {
          city_code: "101280901",
          name: "肇庆",
          province_name: "广东",
          parent_name: "肇庆",
          lng: "23.051546",
          lat: "112.472529"
        },
        {
          city_code: "101281001",
          name: "湛江",
          province_name: "广东",
          parent_name: "湛江",
          lng: "21.274898",
          lat: "110.364977"
        },
        {
          city_code: "101281101",
          name: "江门",
          province_name: "广东",
          parent_name: "江门",
          lng: "22.590431",
          lat: "113.094942"
        },
        {
          city_code: "101281201",
          name: "河源",
          province_name: "广东",
          parent_name: "河源",
          lng: "23.746266",
          lat: "114.697802"
        },
        {
          city_code: "101281301",
          name: "清远",
          province_name: "广东",
          parent_name: "清远",
          lng: "23.685022",
          lat: "113.051227"
        },
        {
          city_code: "101281401",
          name: "云浮",
          province_name: "广东",
          parent_name: "云浮",
          lng: "22.929801",
          lat: "112.044439"
        },
        {
          city_code: "101281501",
          name: "潮州",
          province_name: "广东",
          parent_name: "潮州",
          lng: "23.661701",
          lat: "116.632301"
        },
        {
          city_code: "101281601",
          name: "东莞",
          province_name: "广东",
          parent_name: "东莞",
          lng: "23.046237",
          lat: "113.746262"
        },
        {
          city_code: "101281701",
          name: "中山",
          province_name: "广东",
          parent_name: "中山",
          lng: "22.521113",
          lat: "113.382391"
        },
        {
          city_code: "101281801",
          name: "阳江",
          province_name: "广东",
          parent_name: "阳江",
          lng: "21.859222",
          lat: "111.975107"
        },
        {
          city_code: "101282001",
          name: "茂名",
          province_name: "广东",
          parent_name: "茂名",
          lng: "21.659751",
          lat: "110.919229"
        },
        {
          city_code: "101282101",
          name: "汕尾",
          province_name: "广东",
          parent_name: "汕尾",
          lng: "22.774485",
          lat: "115.364238"
        },
        {
          city_code: "101290101",
          name: "昆明",
          province_name: "云南",
          parent_name: "昆明",
          lng: "25.040609",
          lat: "102.712251"
        },
        {
          city_code: "101290201",
          name: "大理",
          province_name: "云南",
          parent_name: "大理",
          lng: "25.589449",
          lat: "100.225668"
        },
        {
          city_code: "101290301",
          name: "红河",
          province_name: "云南",
          parent_name: "红河",
          lng: "23.366775",
          lat: "103.384182"
        },
        {
          city_code: "101290401",
          name: "曲靖",
          province_name: "云南",
          parent_name: "曲靖",
          lng: "25.501557",
          lat: "103.797851"
        },
        {
          city_code: "101290501",
          name: "保山",
          province_name: "云南",
          parent_name: "保山",
          lng: "25.111802",
          lat: "99.167133"
        },
        {
          city_code: "101290601",
          name: "文山",
          province_name: "云南",
          parent_name: "文山",
          lng: "23.36951",
          lat: "104.24401"
        },
        {
          city_code: "101290701",
          name: "玉溪",
          province_name: "云南",
          parent_name: "玉溪",
          lng: "24.350461",
          lat: "102.543907"
        },
        {
          city_code: "101290801",
          name: "楚雄",
          province_name: "云南",
          parent_name: "楚雄",
          lng: "25.041988",
          lat: "101.546046"
        },
        {
          city_code: "101290901",
          name: "普洱",
          province_name: "云南",
          parent_name: "普洱",
          lng: "22.777321",
          lat: "100.972344"
        },
        {
          city_code: "101291001",
          name: "昭通",
          province_name: "云南",
          parent_name: "昭通",
          lng: "27.336999",
          lat: "103.717216"
        },
        {
          city_code: "101291101",
          name: "临沧",
          province_name: "云南",
          parent_name: "临沧",
          lng: "23.886567",
          lat: "100.08697"
        },
        {
          city_code: "101291201",
          name: "怒江",
          province_name: "云南",
          parent_name: "怒江",
          lng: "25.850949",
          lat: "98.854304"
        },
        {
          city_code: "101291301",
          name: "香格里拉",
          province_name: "云南",
          parent_name: "迪庆",
          lng: "27.825804",
          lat: "99.708667"
        },
        {
          city_code: "101291305",
          name: "迪庆",
          province_name: "云南",
          parent_name: "迪庆",
          lng: "27.826853",
          lat: "99.706463"
        },
        {
          city_code: "101291401",
          name: "丽江",
          province_name: "云南",
          parent_name: "丽江",
          lng: "26.872108",
          lat: "100.233026"
        },
        {
          city_code: "101291501",
          name: "德宏",
          province_name: "云南",
          parent_name: "德宏",
          lng: "24.436694",
          lat: "98.578363"
        },
        {
          city_code: "101291602",
          name: "西双版纳",
          province_name: "云南",
          parent_name: "西双版纳",
          lng: "22.001724",
          lat: "100.797941"
        },
        {
          city_code: "101300101",
          name: "南宁",
          province_name: "广西",
          parent_name: "南宁",
          lng: "22.82402",
          lat: "108.320004"
        },
        {
          city_code: "101300201",
          name: "崇左",
          province_name: "广西",
          parent_name: "崇左",
          lng: "22.404108",
          lat: "107.353926"
        },
        {
          city_code: "101300302",
          name: "柳城",
          province_name: "广西",
          parent_name: "柳州",
          lng: "24.655121",
          lat: "109.245812"
        },
        {
          city_code: "101300401",
          name: "来宾",
          province_name: "广西",
          parent_name: "来宾",
          lng: "23.733766",
          lat: "109.229772"
        },
        {
          city_code: "101300501",
          name: "桂林",
          province_name: "广西",
          parent_name: "桂林",
          lng: "25.274215",
          lat: "110.299121"
        },
        {
          city_code: "101300601",
          name: "梧州",
          province_name: "广西",
          parent_name: "梧州",
          lng: "23.474803",
          lat: "111.297604"
        },
        {
          city_code: "101300701",
          name: "贺州",
          province_name: "广西",
          parent_name: "贺州",
          lng: "24.414141",
          lat: "111.552056"
        },
        {
          city_code: "101300801",
          name: "贵港",
          province_name: "广西",
          parent_name: "贵港",
          lng: "23.0936",
          lat: "109.602146"
        },
        {
          city_code: "101300901",
          name: "玉林",
          province_name: "广西",
          parent_name: "玉林",
          lng: "22.63136",
          lat: "110.154393"
        },
        {
          city_code: "101301001",
          name: "百色",
          province_name: "广西",
          parent_name: "百色",
          lng: "23.897742",
          lat: "106.616285"
        },
        {
          city_code: "101301101",
          name: "钦州",
          province_name: "广西",
          parent_name: "钦州",
          lng: "21.967127",
          lat: "108.624175"
        },
        {
          city_code: "101301201",
          name: "河池",
          province_name: "广西",
          parent_name: "河池",
          lng: "24.695899",
          lat: "108.062105"
        },
        {
          city_code: "101301301",
          name: "北海",
          province_name: "广西",
          parent_name: "北海",
          lng: "21.473343",
          lat: "109.119254"
        },
        {
          city_code: "101301401",
          name: "防城港",
          province_name: "广西",
          parent_name: "防城港",
          lng: "21.614631",
          lat: "108.345478"
        },
        {
          city_code: "101310101",
          name: "海口",
          province_name: "海南",
          parent_name: "海口",
          lng: "20.031971",
          lat: "110.33119"
        },
        {
          city_code: "101310201",
          name: "三亚",
          province_name: "海南",
          parent_name: "三亚",
          lng: "18.247872",
          lat: "109.508268"
        },
        {
          city_code: "101310202",
          name: "东方",
          province_name: "海南",
          parent_name: "东方",
          lng: "19.10198",
          lat: "108.653789"
        },
        {
          city_code: "101310203",
          name: "临高",
          province_name: "海南",
          parent_name: "临高",
          lng: "19.908293",
          lat: "109.687697"
        },
        {
          city_code: "101310204",
          name: "澄迈",
          province_name: "海南",
          parent_name: "澄迈",
          lng: "19.737095",
          lat: "110.007147"
        },
        {
          city_code: "101310205",
          name: "儋州",
          province_name: "海南",
          parent_name: "儋州",
          lng: "19.517486",
          lat: "109.576782"
        },
        {
          city_code: "101310206",
          name: "昌江",
          province_name: "海南",
          parent_name: "昌江",
          lng: "19.260968",
          lat: "109.053351"
        },
        {
          city_code: "101310207",
          name: "白沙",
          province_name: "海南",
          parent_name: "白沙",
          lng: "19.224584",
          lat: "109.452606"
        },
        {
          city_code: "101310208",
          name: "琼中",
          province_name: "海南",
          parent_name: "琼中",
          lng: "19.03557",
          lat: "109.839996"
        },
        {
          city_code: "101310209",
          name: "定安",
          province_name: "海南",
          parent_name: "定安",
          lng: "19.684966",
          lat: "110.349235"
        },
        {
          city_code: "101310210",
          name: "屯昌",
          province_name: "海南",
          parent_name: "屯昌",
          lng: "19.362916",
          lat: "110.102773"
        },
        {
          city_code: "101310211",
          name: "琼海",
          province_name: "海南",
          parent_name: "琼海",
          lng: "19.246011",
          lat: "110.466785"
        },
        {
          city_code: "101310212",
          name: "文昌",
          province_name: "海南",
          parent_name: "文昌",
          lng: "19.612986",
          lat: "110.753975"
        },
        {
          city_code: "101310214",
          name: "保亭",
          province_name: "海南",
          parent_name: "保亭",
          lng: "18.636371",
          lat: "109.70245"
        },
        {
          city_code: "101310215",
          name: "万宁",
          province_name: "海南",
          parent_name: "万宁",
          lng: "18.796216",
          lat: "110.388793"
        },
        {
          city_code: "101310216",
          name: "陵水",
          province_name: "海南",
          parent_name: "陵水",
          lng: "18.505006",
          lat: "110.037218"
        },
        {
          city_code: "101310221",
          name: "乐东",
          province_name: "海南",
          parent_name: "乐东",
          lng: "18.74758",
          lat: "109.175444"
        },
        {
          city_code: "101310222",
          name: "五指山",
          province_name: "海南",
          parent_name: "五指山",
          lng: "18.776921",
          lat: "109.516662"
        },
        {
          city_code: "101310301",
          name: "三沙",
          province_name: "海南",
          parent_name: "三沙",
          lng: "16.831039",
          lat: "112.34882"
        },
        {
          city_code: "101320101",
          name: "香港",
          province_name: "香港",
          parent_name: "中国",
          lng: "22.307",
          lat: "114.177"
        },
        {
          city_code: "101330101",
          name: "澳门",
          province_name: "澳门",
          parent_name: "中国",
          lng: "22.202",
          lat: "113.544"
        },
        {
          city_code: "101340101",
          name: "台北",
          province_name: "台湾",
          parent_name: "台北",
          lng: "25.04",
          lat: "121.516"
        },
        {
          city_code: "101340201",
          name: "高雄",
          province_name: "台湾",
          parent_name: "高雄",
          lng: "22.619",
          lat: "120.276"
        },
        {
          city_code: "101340401",
          name: "台中",
          province_name: "台湾",
          parent_name: "台中",
          lng: "24.144",
          lat: "120.67"
        }
      ]
    };
  },
  components: {},
  created() {
    //触发城市定位
    //this.locationCity();
  },
  async mounted() {
    await loadBMap("B9Hj5SEXA5jNEXDvt2NaHUxGIO8hhcWU"); // 加载引入BMap
    //this.initMap();
    //触发城市定位
    this.locationCity();
  },
  //mounted() {},
  methods: {
    //城市定位
    locationCity() {
      let _this = this;
      //读取缓存
      if (sessionStorage.getItem("LocationCity")) {
        //上面这个就是去到详情页或者编辑页的标识//
        //如果有这个就读取缓存里面的数据
        _this.LocationCity = sessionStorage.getItem("LocationCity");
        let p = sessionStorage.getItem("LocationPro");
        let c = sessionStorage.getItem("LocationCity");
        _this.ErgodicApi(c);
      }
      //没有则执行定位方法
      else {
        //定义获取城市方法
        // eslint-disable-next-line no-undef
        const geolocation = new BMap.Geolocation();
        geolocation.getCurrentPosition(
          function getinfo(position) {
            let addcity = position.address.city; //获取城市信息
            let addprovince = position.address.province; //获取省份信息
            //let latitude = position.latitude;
            //let longitude = position.longitude;
            //省份 城市格式处理
            let p = _this.optimizeP(addprovince);
            let c = _this.optimizeC(p, addcity);

            _this.LocationCity = addcity.split("市")[0];
            sessionStorage.setItem("LocationPro", p);
            sessionStorage.setItem("LocationCity", _this.LocationCity);

            //_this.Getcitycode(latitude, longitude);
            _this.ErgodicApi(c);

            //_this.getWeather(p, c, 1);
          },
          function(e) {
            _this.LocationCity = "定位失败";
          },
          { provider: "baidu" }
        );
      }
    },
    //遍历Apijson
    ErgodicApi(cityname) {
      let _this = this;
      //let nameLen = cityname.length;
      for (let i = 0; i < _this.CityApijson.length; i++) {
        if (cityname == _this.CityApijson[i].name.substring(0, 2)) {
          let city_code = _this.CityApijson[i].city_code;
          let lng = _this.CityApijson[i].lng;
          let lat = _this.CityApijson[i].lat;
          _this.Getcitycode(lng, lat);
          _this.getWeather(city_code, 1);
        } else {
          //console.log("城市匹配失败！");
        }
      }
    },
    //获取citycode
    Getcitycode(latitude, longitude) {
      let _this = this;
      //多个代理可以的封装头是要与URL分开写的，不然系统可能识别不出来。
      let Url = `/v3/?ak=B9Hj5SEXA5jNEXDvt2NaHUxGIO8hhcWU&location=${latitude},${longitude}&output=json&pois=1`;
      _this.$https.fetchGet(_this.$baidumap + Url).then(res => {
        _this.adcode = res.data.result.addressComponent.adcode;
        sessionStorage.setItem("adcode", _this.adcode);
      });
    },
    //请求天气接口weather
    getWeather(city_code, num) {
      var _this = this;
      //读取缓存
      if (num == 1) {
        if (sessionStorage.getItem("weatype")) {
          //上面这个就是去到详情页或者编辑页的标识//
          //如果有这个就读取缓存里面的数据
          _this.weatherlist = JSON.parse(sessionStorage.getItem("weatherlist"));
        }
        //没有则执行定位方法
        else {
          //http://t.weather.itboy.net/api/weather/city/101030100
          _this.$axios
            .get(_this.$wea + "/api/weather/city/" + city_code)
            .then(res => {
              let data = res.data.data;
              this.weatherlist = [];
              for (var i = 0; i < 7; i++) {
                let forecast = data.forecast;
                let adddate = forecast[i].ymd.split("-");
                let addmonth = adddate[1].split("0");

                for (var k = 0; k < this.typeicon.length; k++) {
                  if (_this.typeicon[k].name == forecast[i].type) {
                    _this.weathericon = _this.typeicon[k].icon;
                  }
                }

                _this.weatherlist.push({
                  date: addmonth[1] + "月" + forecast[i].date + "号",
                  //date: forecast[i].ymd,
                  week: forecast[i].week,
                  typeicon: _this.weathericon,
                  highLow:
                    forecast[i].low.split("低温")[1] +
                    "~" +
                    forecast[i].high.split("高温")[1],
                  type: forecast[i].type
                });

                sessionStorage.setItem(
                  "weatherlist",
                  JSON.stringify(_this.weatherlist)
                );
              }
            });
        }
      } else {
        _this.$axios
          .get(_this.$wea + "/api/weather/city/" + city_code)
          .then(res => {
            let data = res.data.data;
            this.weatherlist = [];
            for (var i = 0; i < 7; i++) {
              let forecast = data.forecast;
              let adddate = forecast[i].ymd.split("-");
              let addmonth = adddate[1].split("0");

              for (var k = 0; k < this.typeicon.length; k++) {
                if (_this.typeicon[k].name == forecast[i].type) {
                  _this.weathericon = _this.typeicon[k].icon;
                }
              }

              _this.weatherlist.push({
                date: addmonth[1] + "月" + forecast[i].date + "号",
                //date: forecast[i].ymd,
                week: forecast[i].week,
                typeicon: _this.weathericon,
                highLow:
                  forecast[i].low.split("低温")[1] +
                  "~" +
                  forecast[i].high.split("高温")[1],
                type: forecast[i].type
              });

              sessionStorage.setItem(
                "weatherlist",
                JSON.stringify(_this.weatherlist)
              );
            }
          });
      }
    },
    //获取切换城市信息
    change(value) {
      let _this = this;
      if (value.city != undefined) {
        if (value.province != "请选择") {
          let p = _this.optimizeP(value.province);
          sessionStorage.setItem("LocationPro", p);
          let c;
          if (
            p == "北京" ||
            p == "上海" ||
            p == "天津" ||
            p == "香港" ||
            p == "澳门" ||
            p == "重庆"
          ) {
            c = "";
            _this.LocationCity = p;
            _this.show = false;
          } else {
            if (value.city != "请选择") {
              c = _this.optimizeC(p, value.city);
              // this.weacity = data.cityInfo.city.split("市")[0];
              //_this.LocationCity = value.city.split("市")[0];
              _this.LocationCity = c;
              _this.show = false;
            }
          }
          sessionStorage.setItem("LocationCity", _this.LocationCity);
          _this.ErgodicApi(c);
        }
      }
    },
    //点击判断城市切换div的状态
    choose() {
      this.show = !this.show;
    },
    //省份格式处理
    optimizeP(p) {
      let province;

      province = p.substring(0, 2);

      return province;
    },
    //城市格式处理
    optimizeC(p, c) {
      let newcity;
      let nameLen = c.length;
      if (
        p == "北京" ||
        p == "上海" ||
        p == "天津" ||
        p == "香港" ||
        p == "澳门" ||
        p == "重庆"
      ) {
        newcity = p;
      } else if (nameLen == 3) {
        newcity = c.substring(0, 2);
        this.LocationCity = newcity;
      } else if (nameLen == 4) {
        newcity = c.split("市")[0];
        this.LocationCity = newcity;
      } else {
        newcity = c.substring(0, 4);
        this.LocationCity = newcity;
      }

      return newcity;
    },
    //登录跳转
    Tologin() {
      this.$router.push({ path: "/Login" });
    },
    //个人信息
    Postmy_info() {
      let _this = this;
      let Params = {
        Alltoken:
          "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJiaWdleWVzbW9uc3RlciIsImF1ZCI6ImFfdXNlciIsImlhdCI6MTU5NDg4MDQ0NiwibmJmIjoxNTk0ODgwNDQ2LCJleHAiOjE1OTQ5MTY0NDYsInVpZCI6MX0.zNUUA4Oo8URXzfSRElt0pCX5N7VfodxfyFGbtuTfuk4"
      };
      _this.$axios.post(_this.$basis + "/my_info", Params).then(res => {
        let data = res.data.data;
        let resdata = res.data;
        switch (resdata.code) {
          case 0:
            _this.userId = data.id;
            _this.nick_name = data.nick_name;
            _this.phone = data.phone;
            _this.headerimg = data.headerimg;
            _this.idenName = data.iden; //身份 svip会员   tourist游客
            break;
          case 1:
            console.log(resdata.msg);
            break;
        }
      });
    },
    //个人中心跳转
    Topublic(command) {
      if (command == "/") {
        localStorage.clear();
        location.reload();
        //this.userlogin = false
      } else {
        this.$router.push(command);
      }
    }
  },
  beforeDestroy() {}
};
</script>
<style lang="scss">
@import "../../assets/css/theme";
@import "../../assets/css/tqw_widget_float.css";

.header-con {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-width: 1200px;
  height: 44px;
  padding: 0px 18.75% 11px 18.75%;
  background: #f6f6f6;
  //line-height: 44px;
  text-align: center;
  font-size: 16px;
  letter-spacing: 1px;

  .Calendar_left {
    display: flex;
    justify-content: flex-start;
    padding-top: 20px;
    .Calendar_city {
      display: flex;
      width: auto;
      height: 100%;
      text-align: center;
      .city-hidden {
        display: block;
        width: auto;
        max-width: 70px;
        height: 36px;
        float: left;
        text-align: center;
        overflow: hidden;
      }
      .city-hidden-2 {
        width: 60px;
        height: 36px;
        overflow: hidden;
      }
    }
    .Calendar_seven {
      display: flex;
      width: 125px;
      height: 100%;
      padding-left: 10px;
      .addborder {
        display: inline-block;
        width: 108px;
        height: 24px;
        line-height: 24px;
        border-radius: 5px;
        border: 1px solid #707070;
        font-size: 12px;
      }
    }
    .Calendar_word {
      display: flex;
      width: auto;
      height: 100%;
      padding-left: 10px;
    }
  }

  .Calendar_login {
    display: flex;
    width: auto;
    height: 100%;
    cursor: pointer;
    .login_img {
      padding-top: 3px;
      width: 39px;
      height: 36px;
      overflow: hidden;
    }
    .el-dropdown {
      padding-top: 5px;
      padding-left: 5px;
    }
    .addstuats {
      background-color: #558ff8;
      color: #666666;
    }
    .addstuats:hover {
      background-color: red;
      color: #666666;
    }
    .el-dropdown-menu__item:focus:hover {
      background-color: #558ff8;
      color: #666666;
    }
  }

  .add-position {
    position: relative;
    .choose-area {
      width: 400px;
      height: 200px;
      position: absolute;
      left: 40px;
      top: 30px;
      z-index: 1000;
      .add_location {
        float: left;
      }
    }
  }
  .addmouse {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: #333333;
    cursor: pointer;
  }
}

.el-link.el-link--default {
  color: #ff6f64;
}

.showweather {
  width: 700px;
  height: 160px;
  float: left;
  .s-children {
    width: 100px;
    height: 170px;
    padding-top: 25px;
    float: left;
    .addlist {
      width: 100%;
      height: 20%;
      float: left;
      text-align: center;
    }
  }
}

.icon-size {
  width: 20px;
  height: 100%;
  float: left;
  padding-top: 4px;
}
.icon-size-2 {
  width: 20px;
  height: 100%;
  float: left;
  padding-top: 6px;
}
.icon-size img {
  width: 20px;
  height: 20px;
}
.icon-size-2 img {
  width: 20px;
  height: 20px;
}

.type-size {
  text-align: center;
  cursor: pointer;
}

.addstatue {
  margin-left: 42%;
}
.changecity {
  color: #558ff8;
  cursor: pointer;
}
.changecity :hover {
  color: #558ff8;
}
</style>
